package zmee.pur.src.formplugin;

import kd.bos.bill.AbstractBillPlugIn;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.servicehelper.BusinessDataServiceHelper;

import java.util.EventObject;

/**
 * @Author: xw
 * @Date: 2022/12/12/20:42
 * @Description: 加载评标方式
 */
public class BidOpenConfigByBidDocBillPlugin extends AbstractBillPlugIn {

    @Override
    public void afterBindData(EventObject e) {
        super.afterBindData(e);
        boolean check = (boolean) this.getModel().getValue("zmee_check");
        if (check) {
            return;
        }
        this.getModel().setValue("zmee_check", true);
        Object parentId = this.getModel().getValue("parentid");
        //查询标书编制
        DynamicObject bidDoc = BusinessDataServiceHelper.loadSingle(parentId, "src_biddoc");
        if (null == bidDoc) {
            return;
        }
        String scoreType = bidDoc.getString("zmee_scoretype1");
        this.getModel().setValue("scoretype", scoreType);
    }
}
